import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.monitor.FileAlterationMonitor;
import org.apache.commons.io.monitor.FileAlterationObserver;
import pers.cz.logtail.util.NetUtils;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @program: PostGirl-panent
 * @description: main
 * @author: Cheng Zhi
 * @create: 2022-10-04 12:00
 **/
public class Main {

    public static void main(String[] args) throws Exception {
/*        File directory = new File("D:\\test");
        // 轮询间隔 5 秒
        long interval = TimeUnit.SECONDS.toMillis(5);
        // 创建一个文件观察器用于处理文件的格式
        FileAlterationObserver observer = new FileAlterationObserver(directory, FileFilterUtils.and(
                FileFilterUtils.fileFileFilter(),FileFilterUtils.suffixFileFilter(".sql")));
        Map<String, Long> fileLineRember = new HashMap<>();
        //设置文件变化监听器
        observer.addListener(new LogListenner(fileLineRember));
        FileAlterationMonitor monitor = new FileAlterationMonitor(interval,observer);
        monitor.start();*/
        //Thread.sleep(30000);
        //monitor.stop();
        System.out.println(NetUtils.getLocalIp());
    }
}
